package git.soulbgm.group;

import git.soulbgm.cache.annotation.Group;
import git.soulbgm.cache.enumeration.TimeLevel;
import git.soulbgm.pojo.DataSegmentContentSummaryInfo;
import org.springframework.stereotype.Service;

import static git.soulbgm.common.Constants.GN_STANDING;

/**
 * 出入站数据分组统计
 *
 * @author 贺瑞杰
 * @date 2021/12/31
 */
@Service
public class OutAndInStandingStatisticsGroup {

    /**
     * 出站标识
     */
    public static final int DIRECTION_FLAG_OUT = 1;
    /**
     * 入站标识
     */
    public static final int DIRECTION_FLAG_IN = 2;

    @Group(groupName = GN_STANDING,
            groupBy = {"rbdGroupCode", "dataType", "outboundIdentity", ":" + DIRECTION_FLAG_OUT},
            aggregation = {"COUNT(packetId)", "SUM(msgLength)", "AVG(msgLength)", "MAX(msgLength)", "MIN(msgLength)"},
            timeLevel = TimeLevel.MINUTE, dateField = "receiveTime")
    @Group(groupName = GN_STANDING,
            groupBy = {"sbdGroupCode", "dataType", "inboundIdentity", ":" + DIRECTION_FLAG_IN},
            aggregation = {"COUNT(packetId)", "SUM(msgLength)", "AVG(msgLength)", "MAX(msgLength)", "MIN(msgLength)"},
            timeLevel = TimeLevel.MINUTE, dateField = "receiveTime")
    public void groupOutAndInStandingStatisticsData(DataSegmentContentSummaryInfo info) {
    }

}
